﻿<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>jQuery子元素过滤器:first-child示例</title>
        <script src="js/jquery-3.6.1.min.js"></script>
		<style>
		ul{
			width:100px;
			border:1px solid;
		}
		</style>
    </head>
    <body>
        <h3>jQuery子元素过滤器:first-child示例</h3>
        <hr>
		<ul>
		    <li>Apple</li>
		    <li>Pear</li>
		    <li>Grape</li>
		</ul>
		<ul>
		    <li>Milk</li>
		    <li>Bread</li>
		    <li>Coffee</li>
		</ul>
        <script>
            $(document).ready(function() {
                $("li:first-child").css({fontWeight:"bold",color:"red"});
            });
        </script>
    </body>
</html>